/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import javax.swing.JPanel;
import DAO.garantiasDAO;
import DTO.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
/**
 *
 * @author Luis Olave 10
 */
public class RelacionGarantiaSeguro extends javax.swing.JFrame {

    usuarioDTO user;
    garantiasDAO reg = new garantiasDAO();
   String auxNombre = "";
   relacionGarantiaSeguroHipoDTO hipo;
   relacionGarantiaSeguroAutoDTO auto;
   relacionGarantiaSeguroCdpDTO cdp;
   relacionGarantiaSeguroWarraDTO warra;
    
    public RelacionGarantiaSeguro(usuarioDTO user) {
        this.user = user;
        initComponents();
        this.btnGrabarGtiaRel.setVisible(false);
        this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblLogo = new javax.swing.JLabel();
        lblIngresoGaraAuto = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel10 = new javax.swing.JPanel();
        pnlHipotecaria = new javax.swing.JPanel();
        txtHipoSeg = new javax.swing.JTextField();
        btnBuscarHipo = new javax.swing.JButton();
        pnlAutomotriz = new javax.swing.JPanel();
        txtAutoSeg = new javax.swing.JTextField();
        btnBuscarAuto = new javax.swing.JButton();
        pnlWarrant = new javax.swing.JPanel();
        txtWarraSeg = new javax.swing.JTextField();
        btnBuscarWarrant = new javax.swing.JButton();
        pnlCdp = new javax.swing.JPanel();
        txtCdpSeg = new javax.swing.JTextField();
        btnBuscarCdp = new javax.swing.JButton();
        pnlDatosPersoGara1 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        txtNombreRelac = new javax.swing.JTextField();
        txtApellMatRelac = new javax.swing.JTextField();
        txtApellPatRel = new javax.swing.JTextField();
        txtRutRelac = new javax.swing.JTextField();
        btnMenuPrincipal = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        pnlDescripGarantia = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        txtOtroComentarioRelac = new javax.swing.JTextArea();
        jScrollPane4 = new javax.swing.JScrollPane();
        txtDescripcionRelac = new javax.swing.JTextArea();
        lblDescripcion = new javax.swing.JLabel();
        jPanel13 = new javax.swing.JPanel();
        btnGrabarGtiaRel = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        txtValorPrimaGtiaRel = new javax.swing.JTextField();
        txtCompaniaGtiaRel = new javax.swing.JTextField();
        txtSegColectivoGtiaRel = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        txtPolizaGtiaRel = new javax.swing.JTextField();
        txtMontoAsegGtiaRel = new javax.swing.JTextField();
        cmbTipoPolGtiaRel = new javax.swing.JComboBox();
        jcFechaVencimiento = new com.toedter.calendar.JDateChooser();
        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("RELACIÓN GARANTÍA SEGURO");
        setResizable(false);

        lblLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGE/logo.JPG"))); // NOI18N

        lblIngresoGaraAuto.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
        lblIngresoGaraAuto.setText("RELACIÓN GARANTÍA - SEGURO");

        jTabbedPane1.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N

        pnlHipotecaria.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "INGRESE ROL SII", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        btnBuscarHipo.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnBuscarHipo.setText("BUSCAR");
        btnBuscarHipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarHipoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlHipotecariaLayout = new javax.swing.GroupLayout(pnlHipotecaria);
        pnlHipotecaria.setLayout(pnlHipotecariaLayout);
        pnlHipotecariaLayout.setHorizontalGroup(
            pnlHipotecariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHipotecariaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlHipotecariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtHipoSeg)
                    .addComponent(btnBuscarHipo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlHipotecariaLayout.setVerticalGroup(
            pnlHipotecariaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHipotecariaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(txtHipoSeg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnBuscarHipo))
        );

        pnlAutomotriz.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "INGRESE PATENTE", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        btnBuscarAuto.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnBuscarAuto.setText("BUSCAR");
        btnBuscarAuto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarAutoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlAutomotrizLayout = new javax.swing.GroupLayout(pnlAutomotriz);
        pnlAutomotriz.setLayout(pnlAutomotrizLayout);
        pnlAutomotrizLayout.setHorizontalGroup(
            pnlAutomotrizLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlAutomotrizLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlAutomotrizLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtAutoSeg)
                    .addComponent(btnBuscarAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlAutomotrizLayout.setVerticalGroup(
            pnlAutomotrizLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlAutomotrizLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtAutoSeg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnBuscarAuto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnlWarrant.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "INGRESE CÓDIGO ÚNICO (D.U.N 14)", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        btnBuscarWarrant.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnBuscarWarrant.setText("BUSCAR");
        btnBuscarWarrant.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarWarrantActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlWarrantLayout = new javax.swing.GroupLayout(pnlWarrant);
        pnlWarrant.setLayout(pnlWarrantLayout);
        pnlWarrantLayout.setHorizontalGroup(
            pnlWarrantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlWarrantLayout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(pnlWarrantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtWarraSeg)
                    .addComponent(btnBuscarWarrant, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        pnlWarrantLayout.setVerticalGroup(
            pnlWarrantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlWarrantLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(txtWarraSeg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnBuscarWarrant))
        );

        pnlCdp.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "INGRESE NÚMERO CDP", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        btnBuscarCdp.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnBuscarCdp.setText("BUSCAR");
        btnBuscarCdp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarCdpActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnlCdpLayout = new javax.swing.GroupLayout(pnlCdp);
        pnlCdp.setLayout(pnlCdpLayout);
        pnlCdpLayout.setHorizontalGroup(
            pnlCdpLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlCdpLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlCdpLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtCdpSeg)
                    .addComponent(btnBuscarCdp, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlCdpLayout.setVerticalGroup(
            pnlCdpLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlCdpLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtCdpSeg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnBuscarCdp))
        );

        pnlDatosPersoGara1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DATOS PERSONALES GARANTE", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        jLabel36.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel36.setText("RUT");

        jLabel37.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel37.setText("APELLIDO PATERNO");

        jLabel39.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel39.setText("APELLIDO MATERNO");

        jLabel40.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel40.setText("NOMBRE");

        txtNombreRelac.setBackground(new java.awt.Color(255, 255, 102));
        txtNombreRelac.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtNombreRelac.setEnabled(false);

        txtApellMatRelac.setBackground(new java.awt.Color(255, 255, 102));
        txtApellMatRelac.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtApellMatRelac.setEnabled(false);

        txtApellPatRel.setBackground(new java.awt.Color(255, 255, 102));
        txtApellPatRel.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtApellPatRel.setEnabled(false);

        txtRutRelac.setBackground(new java.awt.Color(255, 255, 102));
        txtRutRelac.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtRutRelac.setEnabled(false);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel37)
                    .addComponent(jLabel36))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtRutRelac, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtApellPatRel, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 153, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel39)
                    .addComponent(jLabel40))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtNombreRelac, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtApellMatRelac, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(196, 196, 196))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36)
                    .addComponent(txtRutRelac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel40)
                    .addComponent(txtNombreRelac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37)
                    .addComponent(txtApellPatRel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel39)
                    .addComponent(txtApellMatRelac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout pnlDatosPersoGara1Layout = new javax.swing.GroupLayout(pnlDatosPersoGara1);
        pnlDatosPersoGara1.setLayout(pnlDatosPersoGara1Layout);
        pnlDatosPersoGara1Layout.setHorizontalGroup(
            pnlDatosPersoGara1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDatosPersoGara1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        pnlDatosPersoGara1Layout.setVerticalGroup(
            pnlDatosPersoGara1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDatosPersoGara1Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        btnMenuPrincipal.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnMenuPrincipal.setText("MENÚ PRINCIPAL");
        btnMenuPrincipal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMenuPrincipalActionPerformed(evt);
            }
        });

        jLabel15.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel15.setText("HIPOTECARIA");

        jLabel16.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel16.setText("AUTOMOTRIZ");

        jLabel17.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel17.setText("WARRANT");

        jLabel18.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel18.setText("CDP");

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(pnlDatosPersoGara1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnMenuPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                        .addGap(70, 70, 70)
                                        .addComponent(pnlHipotecaria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(pnlAutomotriz, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(pnlWarrant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(pnlCdp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 146, Short.MAX_VALUE))))
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGap(108, 108, 108)
                        .addComponent(jLabel15)
                        .addGap(70, 70, 70)
                        .addComponent(jLabel16)
                        .addGap(119, 119, 119)
                        .addComponent(jLabel17)
                        .addGap(117, 117, 117)
                        .addComponent(jLabel18)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel15)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel16)
                        .addComponent(jLabel17)
                        .addComponent(jLabel18)))
                .addGap(18, 18, 18)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(pnlAutomotriz, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(pnlHipotecaria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(pnlWarrant, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlCdp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(49, 49, 49)
                .addComponent(pnlDatosPersoGara1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 107, Short.MAX_VALUE)
                .addComponent(btnMenuPrincipal)
                .addGap(65, 65, 65))
        );

        jTabbedPane1.addTab("INFO. GARANTE", jPanel10);

        pnlDescripGarantia.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DESCRIPCIÓN GARANTIA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        txtOtroComentarioRelac.setBackground(new java.awt.Color(255, 255, 102));
        txtOtroComentarioRelac.setColumns(20);
        txtOtroComentarioRelac.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        txtOtroComentarioRelac.setRows(5);
        txtOtroComentarioRelac.setToolTipText("");
        txtOtroComentarioRelac.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtOtroComentarioRelac.setEnabled(false);
        jScrollPane3.setViewportView(txtOtroComentarioRelac);

        txtDescripcionRelac.setBackground(new java.awt.Color(255, 255, 102));
        txtDescripcionRelac.setColumns(20);
        txtDescripcionRelac.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        txtDescripcionRelac.setRows(5);
        txtDescripcionRelac.setDisabledTextColor(new java.awt.Color(0, 0, 204));
        txtDescripcionRelac.setEnabled(false);
        jScrollPane4.setViewportView(txtDescripcionRelac);

        lblDescripcion.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        lblDescripcion.setText("DESCRIPCIÓN");

        javax.swing.GroupLayout pnlDescripGarantiaLayout = new javax.swing.GroupLayout(pnlDescripGarantia);
        pnlDescripGarantia.setLayout(pnlDescripGarantiaLayout);
        pnlDescripGarantiaLayout.setHorizontalGroup(
            pnlDescripGarantiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDescripGarantiaLayout.createSequentialGroup()
                .addGap(70, 70, 70)
                .addComponent(lblDescripcion)
                .addGap(18, 18, 18)
                .addGroup(pnlDescripGarantiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 666, Short.MAX_VALUE)
                    .addComponent(jScrollPane3))
                .addContainerGap())
        );
        pnlDescripGarantiaLayout.setVerticalGroup(
            pnlDescripGarantiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDescripGarantiaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlDescripGarantiaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblDescripcion)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(31, 31, 31)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(250, 250, 250))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlDescripGarantia, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlDescripGarantia, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(121, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 875, Short.MAX_VALUE)
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 491, Short.MAX_VALUE)
            .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("DESCRIP. GARANTÍA", jPanel12);

        btnGrabarGtiaRel.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnGrabarGtiaRel.setText("GRABAR");
        btnGrabarGtiaRel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGrabarGtiaRelActionPerformed(evt);
            }
        });

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "RELACIÓN GARANTÍA SEGURO", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        jLabel2.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel2.setText("TIPO DE POLIZA");

        jLabel3.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel3.setText("MONTO ASEGURADO");

        jLabel4.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel4.setText("COMPAÑIA");

        jLabel5.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel5.setText("VALOR PRIMA");

        jLabel6.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel6.setText("SEGURO COLECTIVO");

        jLabel7.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel7.setText("PÓLIZA INDIVIDUAL");

        jLabel8.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        jLabel8.setText("FECH. VENCIMIENTO");

        cmbTipoPolGtiaRel.setFont(new java.awt.Font("Century Gothic", 0, 10)); // NOI18N
        cmbTipoPolGtiaRel.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione", "Incendio", "Robo" }));
        cmbTipoPolGtiaRel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbTipoPolGtiaRelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel6))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(txtMontoAsegGtiaRel)
                        .addComponent(cmbTipoPolGtiaRel, 0, 150, Short.MAX_VALUE))
                    .addComponent(txtSegColectivoGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 216, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel4))
                        .addGap(53, 53, 53)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtValorPrimaGtiaRel, javax.swing.GroupLayout.DEFAULT_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCompaniaGtiaRel, javax.swing.GroupLayout.DEFAULT_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addComponent(jLabel7))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(19, 19, 19)
                                .addComponent(txtPolizaGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(jcFechaVencimiento, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                .addContainerGap(30, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtCompaniaGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtValorPrimaGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(cmbTipoPolGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(txtMontoAsegGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(3, 3, 3)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(txtSegColectivoGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(txtPolizaGtiaRel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(jcFechaVencimiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(229, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jButton1.setText("MENÚ PRINCIPAL >>");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGap(0, 364, Short.MAX_VALUE)
                        .addComponent(btnGrabarGtiaRel)
                        .addGap(260, 260, 260)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(btnGrabarGtiaRel))
                .addGap(68, 68, 68))
        );

        jTabbedPane1.addTab("RELACIÓN GTÍA. - SEGURO", jPanel13);

        jLabel1.setText("MENÚ PRINCIPAL\\RELACIÓN GARANTÍA SEGURO");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblLogo)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(114, 114, 114)
                        .addComponent(lblIngresoGaraAuto))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel1)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 880, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblIngresoGaraAuto)
                    .addComponent(lblLogo)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(18, 18, 18)
                .addComponent(jTabbedPane1))
        );

        setSize(new java.awt.Dimension(896, 662));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void btnMenuPrincipalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMenuPrincipalActionPerformed
        MenuPrincipal venMenuPrincipal = new MenuPrincipal(user);
        venMenuPrincipal.setVisible(true);
        RelacionGarantiaSeguro.this.dispose();
    }//GEN-LAST:event_btnMenuPrincipalActionPerformed

    private void btnBuscarHipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarHipoActionPerformed
        if (txtHipoSeg.getText().equals("")) {
            javax.swing.JOptionPane.showMessageDialog(null, "Ingrese ROL");
            this.txtHipoSeg.setText(null);
            this.txtAutoSeg.setText(null);
            this.txtWarraSeg.setText(null);
            this.txtCdpSeg.setText(null);
            limpiar2();
        }
        else
        {
            hipo = reg.BuscarRelacionSeguroHipo(txtHipoSeg.getText());
            if (hipo.getId_gara_seg() != 0) {
                javax.swing.JOptionPane.showMessageDialog(null, "Esta Garantia ya fue asignada a una RELACION-SEGURO. \n Para cualquier modificacion, vaya al modulo de MANTENCION DE RELACION-SEGURO.");
                txtRutRelac.setText(hipo.getHipo().getRut_gara_hipo());
//                txtFolioRelac.setText(String.valueOf(hipo.getHipo().getFolio_garantia_hipo()));
                txtApellMatRelac.setText(hipo.getHipo().getApell_materno_hipo());
                txtApellPatRel.setText(hipo.getHipo().getApell_paterno_hipo());
                txtNombreRelac.setText(hipo.getHipo().getNombre_hipo());
                txtDescripcionRelac.setText(hipo.getHipo().getDescrip_hipo());
                txtOtroComentarioRelac.setText(hipo.getHipo().getComent_hipo());
                cmbTipoPolGtiaRel.setSelectedItem(hipo.getTipo_poliza_gara_seg());
                txtMontoAsegGtiaRel.setText(String.valueOf(hipo.getMonto_aseg_gara_seg()));
                txtSegColectivoGtiaRel.setText(hipo.getSeguro_cole_gara_seg());
                txtCompaniaGtiaRel.setText(hipo.getCompania_gara_seg());
                txtValorPrimaGtiaRel.setText(String.valueOf(hipo.getValor_prima_gara_seg()));
                txtPolizaGtiaRel.setText(String.valueOf(hipo.getPoliza_indiv_gara_seg()));
                Date fcons = DTO.ConversionFechas.convertToDate(hipo.getFech_venci_gara_seg());
                jcFechaVencimiento.setDate(fcons);
//                ocultarPanel(pnlHipotecaria);
                RelacionHecha();
                
                this.txtAutoSeg.setText(null);
                this.txtWarraSeg.setText(null);
                this.txtCdpSeg.setText(null);
            }
            else
            {
                garantiaHipotecariaDTO aux = reg.buscarPorRol(txtHipoSeg.getText());
                hipo.setHipo(aux);
                if (hipo.getHipo().getFolio_garantia_hipo() == 0) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Garantia No Encontrada!");
                    this.txtHipoSeg.setText(null);
                    this.txtAutoSeg.setText(null);
                    this.txtWarraSeg.setText(null);
                    this.txtCdpSeg.setText(null);
                    limpiar2();
                }
                else
                {
                    txtRutRelac.setText(hipo.getHipo().getRut_gara_hipo());
//                    txtFolioRelac.setText(String.valueOf(hipo.getHipo().getFolio_garantia_hipo()));
                    txtApellMatRelac.setText(hipo.getHipo().getApell_materno_hipo());
                    txtApellPatRel.setText(hipo.getHipo().getApell_paterno_hipo());
                    txtNombreRelac.setText(hipo.getHipo().getNombre_hipo());
                    txtDescripcionRelac.setText(hipo.getHipo().getDescrip_hipo());
                    txtOtroComentarioRelac.setText(hipo.getHipo().getComent_hipo());
                    auxNombre = "Hipotecaria";
                    limpiar();
                    this.txtAutoSeg.setText(null);
                    this.txtWarraSeg.setText(null);
                    this.txtCdpSeg.setText(null);
                    //metoto que oculta los paneles que no se ocupan
//                    ocultarPanel(pnlHipotecaria);
                }
            }
        }
    }//GEN-LAST:event_btnBuscarHipoActionPerformed

    private void btnBuscarAutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarAutoActionPerformed
        if (txtAutoSeg.getText().equals("")) {
            javax.swing.JOptionPane.showMessageDialog(null, "Ingrese PATENTE");
            this.txtHipoSeg.setText(null);
            this.txtAutoSeg.setText(null);
            this.txtWarraSeg.setText(null);
            this.txtCdpSeg.setText(null);
            limpiar2();
        }
        else
        {
            auto = reg.BuscarRelacionSeguroAuto(txtAutoSeg.getText());
            if (auto.getId_gara_seg() != 0) {
                javax.swing.JOptionPane.showMessageDialog(null, "Esta Garantia ya fue asignada a una RELACION-SEGURO. \n Para cualquier modificacion, vaya al modulo de MANTENCION DE RELACION-SEGURO.");
                txtRutRelac.setText(auto.getAuto().getRut_gara_auto());
//                txtFolioRelac.setText(String.valueOf(auto.getAuto().getFolio_garantia_auto()));
                txtApellMatRelac.setText(auto.getAuto().getApell_materno_auto());
                txtApellPatRel.setText(auto.getAuto().getApell_paterno_auto());
                txtNombreRelac.setText(auto.getAuto().getNombre_auto());
                txtDescripcionRelac.setText(auto.getAuto().getDescrip_auto());
                txtOtroComentarioRelac.setText(auto.getAuto().getComent_auto());
                cmbTipoPolGtiaRel.setSelectedItem(auto.getTipo_poliza_gara_seg());
                txtMontoAsegGtiaRel.setText(String.valueOf(auto.getMonto_aseg_gara_seg()));
                txtSegColectivoGtiaRel.setText(auto.getSeguro_cole_gara_seg());
                txtCompaniaGtiaRel.setText(auto.getCompania_gara_seg());
                txtValorPrimaGtiaRel.setText(String.valueOf(auto.getValor_prima_gara_seg()));
                txtPolizaGtiaRel.setText(String.valueOf(auto.getPoliza_indiv_gara_seg()));
                Date fcons = DTO.ConversionFechas.convertToDate(auto.getFech_venci_gara_seg());
                jcFechaVencimiento.setDate(fcons);
//                ocultarPanel(pnlAutomotriz);
                RelacionHecha();
                this.txtHipoSeg.setText(null);
                this.txtWarraSeg.setText(null);
                this.txtCdpSeg.setText(null);
            }
            else
            {
                garantiaAutomotrizDTO aux = reg.buscarPorPatente(txtAutoSeg.getText());
                auto.setAuto(aux);
                if (auto.getAuto().getFolio_garantia_auto() == 0) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Garantia No Encontrada!");
                    this.txtHipoSeg.setText(null);
                    this.txtAutoSeg.setText(null);
                    this.txtWarraSeg.setText(null);
                    this.txtCdpSeg.setText(null);
                    limpiar2();
                }
                else
                {
                    txtRutRelac.setText(auto.getAuto().getRut_gara_auto());
//                txtFolioRelac.setText(String.valueOf(auto.getAuto().getFolio_garantia_auto()));
                txtApellMatRelac.setText(auto.getAuto().getApell_materno_auto());
                txtApellPatRel.setText(auto.getAuto().getApell_paterno_auto());
                txtNombreRelac.setText(auto.getAuto().getNombre_auto());
                txtDescripcionRelac.setText(auto.getAuto().getDescrip_auto());
                txtOtroComentarioRelac.setText(auto.getAuto().getComent_auto());
                    auxNombre = "Automotriz";
                    limpiar();
                    this.txtHipoSeg.setText(null);                   
                    this.txtWarraSeg.setText(null);
                    this.txtCdpSeg.setText(null);
                    //metoto que oculta los paneles que no se ocupan
//                    ocultarPanel(pnlAutomotriz);
                }
            }
        }
    }//GEN-LAST:event_btnBuscarAutoActionPerformed

    private void btnBuscarWarrantActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarWarrantActionPerformed
        if (txtWarraSeg.getText().equals("")) {
            javax.swing.JOptionPane.showMessageDialog(null, "Ingrese DUN");
            this.txtHipoSeg.setText(null);
            this.txtAutoSeg.setText(null);
            this.txtWarraSeg.setText(null);
            this.txtCdpSeg.setText(null);
            limpiar2();
        }
        else
        {
            warra = reg.BuscarRelacionSeguroWarra(txtWarraSeg.getText());
            if (warra.getId_gara_seg() != 0) {
                javax.swing.JOptionPane.showMessageDialog(null, "Esta Garantia ya fue asignada a una RELACION-SEGURO. \n Para cualquier modificacion, vaya al modulo de MANTENCION DE RELACION-SEGURO.");
                txtRutRelac.setText(warra.getWarra().getRut_garante_warra());
//                txtFolioRelac.setText(String.valueOf(warra.getWarra().getFolio_warra()));
                txtApellMatRelac.setText(warra.getWarra().getApell_materno_warra());
                txtApellPatRel.setText(warra.getWarra().getApell_paterno_warra());
                txtNombreRelac.setText(warra.getWarra().getNombre_warra());
                txtDescripcionRelac.setText(warra.getWarra().getDescrip_warra());
                txtOtroComentarioRelac.setText(warra.getWarra().getComent_warra());
                cmbTipoPolGtiaRel.setSelectedItem(warra.getTipo_poliza_gara_seg());
                txtMontoAsegGtiaRel.setText(String.valueOf(warra.getMonto_aseg_gara_seg()));
                txtSegColectivoGtiaRel.setText(warra.getSeguro_cole_gara_seg());
                txtCompaniaGtiaRel.setText(warra.getCompania_gara_seg());
                txtValorPrimaGtiaRel.setText(String.valueOf(warra.getValor_prima_gara_seg()));
                txtPolizaGtiaRel.setText(String.valueOf(warra.getPoliza_indiv_gara_seg()));
                Date fcons = DTO.ConversionFechas.convertToDate(warra.getFech_venci_gara_seg());
                jcFechaVencimiento.setDate(fcons);
//                ocultarPanel(pnlWarrant);
                RelacionHecha();
                this.txtHipoSeg.setText(null);
                this.txtAutoSeg.setText(null);
                
                this.txtCdpSeg.setText(null);
            }
            else
            {
                garantiaWarrantsDTO aux = reg.buscarPorDUN(txtWarraSeg.getText());
                warra.setWarra(aux);
                if (warra.getWarra().getFolio_warra() == 0) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Garantia No Encontrada!");
                    this.txtHipoSeg.setText(null);
                    this.txtAutoSeg.setText(null);
                    this.txtWarraSeg.setText(null);
                    this.txtCdpSeg.setText(null);
                    limpiar2();
                }
                else
                {
                    txtRutRelac.setText(warra.getWarra().getRut_garante_warra());
//                    txtFolioRelac.setText(String.valueOf(warra.getWarra().getFolio_warra()));
                    txtApellMatRelac.setText(warra.getWarra().getApell_materno_warra());
                    txtApellPatRel.setText(warra.getWarra().getApell_paterno_warra());
                    txtNombreRelac.setText(warra.getWarra().getNombre_warra());
                    txtDescripcionRelac.setText(warra.getWarra().getDescrip_warra());
                    txtOtroComentarioRelac.setText(warra.getWarra().getComent_warra());
                    auxNombre = "Warrant";
                    this.txtHipoSeg.setText(null);
                    this.txtAutoSeg.setText(null);
                    limpiar();
                    this.txtCdpSeg.setText(null);
                    //metoto que oculta los paneles que no se ocupan
//                    ocultarPanel(pnlWarrant);
                }
            }
        }
    }//GEN-LAST:event_btnBuscarWarrantActionPerformed

    private void btnBuscarCdpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarCdpActionPerformed
        if (txtCdpSeg.getText().equals("")) {
            javax.swing.JOptionPane.showMessageDialog(null, "Ingrese NUMERO CDP");
            this.txtHipoSeg.setText(null);
            this.txtAutoSeg.setText(null);
            this.txtWarraSeg.setText(null);
            this.txtCdpSeg.setText(null);
            limpiar2();
        }
        else
        {
            cdp = reg.BuscarRelacionSeguroCdp(Integer.parseInt(txtCdpSeg.getText().trim()));
            if (cdp.getId_gara_seg() != 0) {
                javax.swing.JOptionPane.showMessageDialog(null, "Esta Garantia ya fue asignada a una RELACION-SEGURO. \n Para cualquier modificacion, vaya al modulo de MANTENCION DE RELACION-SEGURO.");
                txtRutRelac.setText(cdp.getCdp().getRut_gara_cdp());
//                txtFolioRelac.setText(String.valueOf(cdp.getCdp().getFolio_cdp()));
                txtApellMatRelac.setText(cdp.getCdp().getApell_materno_cdp());
                txtApellPatRel.setText(cdp.getCdp().getApell_paterno_cdp());
                txtNombreRelac.setText(cdp.getCdp().getNombre_cdp());
                txtDescripcionRelac.setText(cdp.getCdp().getDescrip_cdp());
                txtOtroComentarioRelac.setText(cdp.getCdp().getComent_cdp());
                cmbTipoPolGtiaRel.setSelectedItem(cdp.getTipo_poliza_gara_seg());
                txtMontoAsegGtiaRel.setText(String.valueOf(cdp.getMonto_aseg_gara_seg()));
                txtSegColectivoGtiaRel.setText(cdp.getSeguro_cole_gara_seg());
                txtCompaniaGtiaRel.setText(cdp.getCompania_gara_seg());
                txtValorPrimaGtiaRel.setText(String.valueOf(cdp.getValor_prima_gara_seg()));
                txtPolizaGtiaRel.setText(String.valueOf(cdp.getPoliza_indiv_gara_seg()));
                Date fcons = DTO.ConversionFechas.convertToDate(cdp.getFech_venci_gara_seg());
                jcFechaVencimiento.setDate(fcons);
//                ocultarPanel(pnlCdp);
                RelacionHecha();
                this.txtHipoSeg.setText(null);
                this.txtAutoSeg.setText(null);
                this.txtWarraSeg.setText(null);
                
            }
            else
            {
                garantiaCdpOtrosDTO aux = reg.buscarPorNum(Integer.parseInt(txtCdpSeg.getText().trim()));
                cdp.setCdp(aux);
                if (cdp.getCdp().getFolio_cdp() == 0) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Garantia No Encontrada!");
                    this.txtHipoSeg.setText(null);
                    this.txtAutoSeg.setText(null);
                    this.txtWarraSeg.setText(null);
                    this.txtCdpSeg.setText(null);
                    limpiar2();
                }
                else
                {
                    txtRutRelac.setText(cdp.getCdp().getRut_gara_cdp());
//                    txtFolioRelac.setText(String.valueOf(cdp.getCdp().getFolio_cdp()));
                    txtApellMatRelac.setText(cdp.getCdp().getApell_materno_cdp());
                    txtApellPatRel.setText(cdp.getCdp().getApell_paterno_cdp());
                    txtNombreRelac.setText(cdp.getCdp().getNombre_cdp());
                    txtDescripcionRelac.setText(cdp.getCdp().getDescrip_cdp());
                    txtOtroComentarioRelac.setText(cdp.getCdp().getComent_cdp());
                    auxNombre = "CDP";
                    this.txtHipoSeg.setText(null);
                    this.txtAutoSeg.setText(null);
                    this.txtWarraSeg.setText(null);
                    limpiar();
                    //metoto que oculta los paneles que no se ocupan
//                    ocultarPanel(pnlCdp);
                }
            }
        }
    }//GEN-LAST:event_btnBuscarCdpActionPerformed

    private void btnGrabarGtiaRelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGrabarGtiaRelActionPerformed
        switch(auxNombre)
        {
            case "Hipotecaria":
                if (cmbTipoPolGtiaRel.getSelectedItem().toString().equalsIgnoreCase("Seleccione Tipo Poliza")) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Por favor seleccione un Tipo de Poliza.");
                }
                else
                {
                    hipo.setTipo_poliza_gara_seg(cmbTipoPolGtiaRel.getSelectedItem().toString());
                    if (jcFechaVencimiento.getDate() != null) {
                        hipo.setFech_venci_gara_seg(new SimpleDateFormat("dd/MM/yyyy").format(jcFechaVencimiento.getDate()));
                    }
                    if (!txtMontoAsegGtiaRel.getText().equals("")) {
                        hipo.setMonto_aseg_gara_seg(Integer.parseInt(txtMontoAsegGtiaRel.getText().trim()));
                    }
                    if (!txtSegColectivoGtiaRel.getText().equals("")) {
                        hipo.setSeguro_cole_gara_seg(txtSegColectivoGtiaRel.getText());
                    }
                    if (!txtCompaniaGtiaRel.getText().equals("")) {
                        hipo.setCompania_gara_seg(txtCompaniaGtiaRel.getText());
                    }
                    if (!txtValorPrimaGtiaRel.getText().equals("")) {
                        hipo.setValor_prima_gara_seg(Integer.parseInt(txtValorPrimaGtiaRel.getText()));
                    }
                    if (!txtPolizaGtiaRel.getText().equals("")) {
                        hipo.setPoliza_indiv_gara_seg(Integer.parseInt(txtPolizaGtiaRel.getText()));
                    }
                    int respuesta = javax.swing.JOptionPane.showConfirmDialog(null, "Se grabara la Relacion-Seguro: HIPOTECARIA", "RELACION-SEGURO", JOptionPane.OK_CANCEL_OPTION);
                    if (respuesta == 0) {
                        reg.RelGarantiaSeguroHipo(hipo, user);
                        javax.swing.JOptionPane.showMessageDialog(null, "Relacion Seguro Exitosa!");
                        MenuPrincipal admi = new MenuPrincipal(user);
                        admi.setVisible(true);
                        RelacionGarantiaSeguro.this.dispose();
                    }
                    else
                    {

                    }
                }
                break;
            case "Automotriz":
                if (cmbTipoPolGtiaRel.getSelectedItem().toString().equalsIgnoreCase("Seleccione Tipo Poliza")) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Por favor seleccione un Tipo de Poliza.");
                }
                else
                {
                    auto.setTipo_poliza_gara_seg(cmbTipoPolGtiaRel.getSelectedItem().toString());
                    if (jcFechaVencimiento.getDate() != null) {
                        auto.setFech_venci_gara_seg(new SimpleDateFormat("dd/MM/yyyy").format(jcFechaVencimiento.getDate()));
                    }
                    if (!txtMontoAsegGtiaRel.getText().equals("")) {
                        auto.setMonto_aseg_gara_seg(Integer.parseInt(txtMontoAsegGtiaRel.getText().trim()));
                    }
                    if (!txtSegColectivoGtiaRel.getText().equals("")) {
                        auto.setSeguro_cole_gara_seg(txtSegColectivoGtiaRel.getText());
                    }
                    if (!txtCompaniaGtiaRel.getText().equals("")) {
                        auto.setCompania_gara_seg(txtCompaniaGtiaRel.getText());
                    }
                    if (!txtValorPrimaGtiaRel.getText().equals("")) {
                        auto.setValor_prima_gara_seg(Integer.parseInt(txtValorPrimaGtiaRel.getText()));
                    }
                    if (!txtPolizaGtiaRel.getText().equals("")) {
                        auto.setPoliza_indiv_gara_seg(Integer.parseInt(txtPolizaGtiaRel.getText()));
                    }
                    int respuesta1 = javax.swing.JOptionPane.showConfirmDialog(null, "Se grabara la Relacion-Seguro: AUTOMOTRIZ", "RELACION-SEGURO", JOptionPane.OK_CANCEL_OPTION);
                    if (respuesta1 == 0) {
                        reg.RelGarantiaSeguroAuto(auto, user);
                        javax.swing.JOptionPane.showMessageDialog(null, "Relacion Operacion Exitosa!");
                        MenuPrincipal admi = new MenuPrincipal(user);
                        admi.setVisible(true);
                        RelacionGarantiaSeguro.this.dispose();
                    }
                    else
                    {

                    }
                }
                break;
           case "Warrant":
                if (cmbTipoPolGtiaRel.getSelectedItem().toString().equalsIgnoreCase("Seleccione Tipo Poliza")) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Por favor seleccione un Tipo de Poliza.");
                }
                else
                {
                    warra.setTipo_poliza_gara_seg(cmbTipoPolGtiaRel.getSelectedItem().toString());
                    if (jcFechaVencimiento.getDate() != null) {
                        warra.setFech_venci_gara_seg(new SimpleDateFormat("dd/MM/yyyy").format(jcFechaVencimiento.getDate()));
                    }
                    if (!txtMontoAsegGtiaRel.getText().equals("")) {
                        warra.setMonto_aseg_gara_seg(Integer.parseInt(txtMontoAsegGtiaRel.getText().trim()));
                    }
                    if (!txtSegColectivoGtiaRel.getText().equals("")) {
                        warra.setSeguro_cole_gara_seg(txtSegColectivoGtiaRel.getText());
                    }
                    if (!txtCompaniaGtiaRel.getText().equals("")) {
                        warra.setCompania_gara_seg(txtCompaniaGtiaRel.getText());
                    }
                    if (!txtValorPrimaGtiaRel.getText().equals("")) {
                        warra.setValor_prima_gara_seg(Integer.parseInt(txtValorPrimaGtiaRel.getText()));
                    }
                    if (!txtPolizaGtiaRel.getText().equals("")) {
                        warra.setPoliza_indiv_gara_seg(Integer.parseInt(txtPolizaGtiaRel.getText()));
                    }
                    int respuesta2 = javax.swing.JOptionPane.showConfirmDialog(null, "Se grabara la Relacion-Seguro: WARRANT", "RELACION-SEGURO", JOptionPane.OK_CANCEL_OPTION);
                    if (respuesta2 == 0) {
                        reg.RelGarantiaSeguroWarra(warra, user);
                        javax.swing.JOptionPane.showMessageDialog(null, "Relacion Operacion Exitosa!");
                        MenuPrincipal admi = new MenuPrincipal(user);
                        admi.setVisible(true);
                        RelacionGarantiaSeguro.this.dispose();
                    }
                    else
                    {

                    }
                }
                break;     
           case "CDP":
                if (cmbTipoPolGtiaRel.getSelectedItem().toString().equalsIgnoreCase("Seleccione Tipo Poliza")) {
                    javax.swing.JOptionPane.showMessageDialog(null, "Por favor seleccione un Tipo de Poliza.");
                }
                else
                {
                    cdp.setTipo_poliza_gara_seg(cmbTipoPolGtiaRel.getSelectedItem().toString());
                    if (jcFechaVencimiento.getDate() != null) {
                        cdp.setFech_venci_gara_seg(new SimpleDateFormat("dd/MM/yyyy").format(jcFechaVencimiento.getDate()));
                    }
                    if (!txtMontoAsegGtiaRel.getText().equals("")) {
                        cdp.setMonto_aseg_gara_seg(Integer.parseInt(txtMontoAsegGtiaRel.getText().trim()));
                    }
                    if (!txtSegColectivoGtiaRel.getText().equals("")) {
                        cdp.setSeguro_cole_gara_seg(txtSegColectivoGtiaRel.getText());
                    }
                    if (!txtCompaniaGtiaRel.getText().equals("")) {
                        cdp.setCompania_gara_seg(txtCompaniaGtiaRel.getText());
                    }
                    if (!txtValorPrimaGtiaRel.getText().equals("")) {
                        cdp.setValor_prima_gara_seg(Integer.parseInt(txtValorPrimaGtiaRel.getText()));
                    }
                    if (!txtPolizaGtiaRel.getText().equals("")) {
                        cdp.setPoliza_indiv_gara_seg(Integer.parseInt(txtPolizaGtiaRel.getText()));
                    }
                    int respuesta3 = javax.swing.JOptionPane.showConfirmDialog(null, "Se grabara la Relacion-Seguro: CDP", "RELACION-SEGURO", JOptionPane.OK_CANCEL_OPTION);
                    if (respuesta3 == 0) {
                        reg.RelGarantiaSegurocdp(cdp, user);
                        javax.swing.JOptionPane.showMessageDialog(null, "Relacion Operacion Exitosa!");
                        MenuPrincipal admi = new MenuPrincipal(user);
                        admi.setVisible(true);
                        RelacionGarantiaSeguro.this.dispose();
                    }
                    else
                    {

                    }
                }
                break;
        }
    }//GEN-LAST:event_btnGrabarGtiaRelActionPerformed

    private void cmbTipoPolGtiaRelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbTipoPolGtiaRelActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cmbTipoPolGtiaRelActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        MenuPrincipal venMenuPrincipal = new MenuPrincipal(user);
        venMenuPrincipal.setVisible(true);
        RelacionGarantiaSeguro.this.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed


    private void RelacionHecha()
    {
        btnGrabarGtiaRel.setVisible(false);
        cmbTipoPolGtiaRel.setEnabled(true);
        txtMontoAsegGtiaRel.setEditable(true);
        txtSegColectivoGtiaRel.setEditable(true);
        txtCompaniaGtiaRel.setEditable(true);
        txtPolizaGtiaRel.setEditable(true);
        txtValorPrimaGtiaRel.setEditable(true);
        jcFechaVencimiento.setEnabled(true);
    }
    
//    private void ocultarPanel(JPanel panel)
//    {
//        pnlAutomotriz.setEnabled(false);
//        pnlCdp.setEnabled(false);
//        pnlHipotecaria.setEnabled(false);
//        pnlWarrant.setEnabled(false);
//        /*BOTONES*/
//        txtHipoSeg.setEditable(false);
//        btnBuscarHipo.setEnabled(false);
//        txtAutoSeg.setEditable(false);
//        btnBuscarAuto.setEnabled(false);
//        txtWarraSeg.setEditable(false);
//        btnBuscarWarrant.setEnabled(false);
//        txtCdpSeg.setEditable(false);
//        btnBuscarCdp.setEnabled(false);
//        panel.setEnabled(true);
//    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBuscarAuto;
    private javax.swing.JButton btnBuscarCdp;
    private javax.swing.JButton btnBuscarHipo;
    private javax.swing.JButton btnBuscarWarrant;
    private javax.swing.JButton btnGrabarGtiaRel;
    private javax.swing.JButton btnMenuPrincipal;
    private javax.swing.JComboBox cmbTipoPolGtiaRel;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private com.toedter.calendar.JDateChooser jcFechaVencimiento;
    private javax.swing.JLabel lblDescripcion;
    private javax.swing.JLabel lblIngresoGaraAuto;
    private javax.swing.JLabel lblLogo;
    private javax.swing.JPanel pnlAutomotriz;
    private javax.swing.JPanel pnlCdp;
    private javax.swing.JPanel pnlDatosPersoGara1;
    private javax.swing.JPanel pnlDescripGarantia;
    private javax.swing.JPanel pnlHipotecaria;
    private javax.swing.JPanel pnlWarrant;
    private javax.swing.JTextField txtApellMatRelac;
    private javax.swing.JTextField txtApellPatRel;
    private javax.swing.JTextField txtAutoSeg;
    private javax.swing.JTextField txtCdpSeg;
    private javax.swing.JTextField txtCompaniaGtiaRel;
    private javax.swing.JTextArea txtDescripcionRelac;
    private javax.swing.JTextField txtHipoSeg;
    private javax.swing.JTextField txtMontoAsegGtiaRel;
    private javax.swing.JTextField txtNombreRelac;
    private javax.swing.JTextArea txtOtroComentarioRelac;
    private javax.swing.JTextField txtPolizaGtiaRel;
    private javax.swing.JTextField txtRutRelac;
    private javax.swing.JTextField txtSegColectivoGtiaRel;
    private javax.swing.JTextField txtValorPrimaGtiaRel;
    private javax.swing.JTextField txtWarraSeg;
    // End of variables declaration//GEN-END:variables

    private void limpiar2() {
        btnGrabarGtiaRel.setVisible(false);
        cmbTipoPolGtiaRel.setSelectedItem("Seleccione");
        txtMontoAsegGtiaRel.setText(null);
        txtSegColectivoGtiaRel.setText(null);
        txtCompaniaGtiaRel.setText(null);
        txtPolizaGtiaRel.setText(null);
        txtValorPrimaGtiaRel.setText(null);
        jcFechaVencimiento.setCalendar(null);
        txtRutRelac.setText(null);
//        txtFolioRelac.setText(null);
        txtApellMatRelac.setText(null);
        txtApellPatRel.setText(null);
        txtNombreRelac.setText(null);
        txtDescripcionRelac.setText(null);
        txtOtroComentarioRelac.setText(null);
    }

    private void limpiar() {
        btnGrabarGtiaRel.setVisible(true);
        cmbTipoPolGtiaRel.setSelectedItem("Seleccione");
        txtMontoAsegGtiaRel.setText(null);
        txtSegColectivoGtiaRel.setText(null);
        txtCompaniaGtiaRel.setText(null);
        txtPolizaGtiaRel.setText(null);
        txtValorPrimaGtiaRel.setText(null);
        jcFechaVencimiento.setCalendar(null);
    }
    
}
